// types/public-xs/purchaseInvoice.ts
export enum InvoiceType {
    Normal = 0, // 普通
    RedFlush = 1,   // 红冲
    Return = 2  // 退货
}

export enum CodeState {
    Void = 0,   // 已作废
    NotAudited = 1, // 未审核
    NotExecuted = 2,    // 未执行
    Executed = 3    // 已执行
}

export interface PurchaseInvoice {
    id: number;
    code: string;
    codeDate: string; // YYYY-MM-DD 格式
    invoiceType: InvoiceType;
    supplierId: number | null;
    invoiceNum: string;
    codeState: CodeState;
    originalOrderNum: string;
    amount: number;
    orderCreationTime: Date;
    orderCreator: string;
    orderDepartment: string;
    modifyTime: Date;
    modifier: string;
    isDelete: number;
}

export interface PurchaseInvoiceDetail {
    id: number;
    invoiceCode: string;
    goodId: number;
    quantity: number;
    actualPrice: number;
    tax: number;
    discountRate: number;
    notes: string;
    createBy: string;
    createTime: string;
    updateBy: string;
    updateTime: string;
    warehouseId: number;
    isDelete?: number;
}
